Release 10.1A: OpenEdge Development:
Progress 4GL Reference
CHR function
Converts an integer value to its corresponding character value.
Syntax
expressionAn expression that yields an integer value that you want to convert to a character value.
If the value of
expressionis in the range of 1 to 255, CHR returns a single character. This character might not be printable or might not display on certain terminals. For a value greater than 255 and less than 65535, the CHR function checks for a corresponding lead-byte value. If the integer value corresponds to a valid lead-byte, the CHR returns a double-byte character.The CHR function returns a null string if the
expressionyields a value outside of the range 1 to 65534 or theexpressionyields a value in the range 256 to 65534 and the value does not correspond to a valid lead-byte.target-codepageA character-string expression that evaluates to the name of a code page. The name that you specify must be a valid code page name available in the
DLC/convmap.cpfile (a binary file that contains all of the tables that Progress uses for character management). If you supply a non-valid name, the CHR function returns a null string. Before returning a character value, the CHR function convertsexpressionfromsource-codepagetotarget-codepage. The returned character value is relative totarget-codepage. If you do not specifytarget-codepage, no code page conversions occur.source-codepageA character-string expression that evaluates to the name of a code page. The name that you specify must be a valid code page name available in the
ExampleDLC/convmap.cpfile. If you supply a non-valid name, the CHR function returns a null string. Thesource-codepagespecifies the name of the code page to whichexpressionis relative. The default value ofsource-codepageis the value of SESSION:CHARSET.This procedure initializes the 26 elements of the letter array to the letters A through Z:
Notes
- The CHR function returns the corresponding character in the specified code page. By default, the value of SESSION:CHARSET is iso8859-1. You can set a different internal code page by specifying the Internal Code Page (-cpinternal) parameter. For more information, see OpenEdge Deployment: Startup Command and Parameter Reference .
- The CHR function is double-byte enabled. For a value greater than 255 and less than 65535, it checks for a lead-byte value. If the lead-byte value is valid, Progress creates and returns a double-byte character.
See also
ASC function, CODEPAGE-CONVERT function, SESSION system handle, STRING function
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |